package admin

import "go-amis-admin/amis"

type Dashboard struct {
	EmptyModule
}

func NewDashboard(basePath string) *Dashboard {
	return &Dashboard{
		EmptyModule: NewEmptyModule("首页", "dashboard", "fa fa-home", 0, basePath),
	}
}

func (d *Dashboard) IndexView(ctx *AdminContext) {
	d.PageSchema = amis.New("page").Set("body", []amis.Obj{
		{
			"type":  "panel",
			"title": "关于",
			"body": []amis.Obj{
				{
					"type": "tpl",
					"tpl":  "欢迎使用go-amis-admin",
				},
			},
		},
	})
	ctx.Sucess(d.PageSchema, "")
}
